<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Stg to C--: code generation for constructors</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- This module provides the support code for StgToCmm to deal with</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- constructors on the RHSs of let(rec)s.</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- (c) The University of Glasgow 2004-2006</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.StgToCmm.DataCon</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#cgTopRhsCon"><span class="hs-identifier">cgTopRhsCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#buildDynCon"><span class="hs-identifier">buildDynCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#bindConArgs"><span class="hs-identifier">bindConArgs</span></a></span><span>
</span><span id="line-16"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html"><span class="hs-identifier">GHC.Stg.Syntax</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.html#AltCon"><span class="hs-identifier">AltCon</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html"><span class="hs-identifier">GHC.StgToCmm.Monad</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Env.html"><span class="hs-identifier">GHC.StgToCmm.Env</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Heap.html"><span class="hs-identifier">GHC.StgToCmm.Heap</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Layout.html"><span class="hs-identifier">GHC.StgToCmm.Layout</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html"><span class="hs-identifier">GHC.StgToCmm.Utils</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html"><span class="hs-identifier">GHC.StgToCmm.Closure</span></a></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html"><span class="hs-identifier">GHC.Cmm.Expr</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html"><span class="hs-identifier">GHC.Cmm.Graph</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html#CafInfo"><span class="hs-identifier">CafInfo</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html#NoCafRefs"><span class="hs-identifier">NoCafRefs</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#isInternalName"><span class="hs-identifier">isInternalName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.RepType.html"><span class="hs-identifier">GHC.Types.RepType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.RepType.html#countConRepArgs"><span class="hs-identifier">countConRepArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Utils.html"><span class="hs-identifier">GHC.Builtin.Utils</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Monad.html#mapMaybeM"><span class="hs-identifier">mapMaybeM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-57"></span><span class="hs-comment">--      Top-level constructors</span><span>
</span><span id="line-58"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#cgTopRhsCon"><span class="hs-identifier hs-type">cgTopRhsCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-61"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>               </span><span class="hs-comment">-- Name of thing bound to this RHS</span><span>
</span><span id="line-62"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>          </span><span class="hs-comment">-- Id</span><span>
</span><span id="line-63"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Args</span><span>
</span><span id="line-64"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span id="cgTopRhsCon"><span class="annot"><span class="annottext">cgTopRhsCon :: DynFlags
-&gt; Id -&gt; DataCon -&gt; [NonVoid StgArg] -&gt; (CgIdInfo, FCode ())
</span><a href="GHC.StgToCmm.DataCon.html#cgTopRhsCon"><span class="hs-identifier hs-var hs-var">cgTopRhsCon</span></a></span></span><span> </span><span id="local-6989586621681060859"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060859"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681060858"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060858"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span id="local-6989586621681060857"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060857"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681060856"><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060856"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681060855"><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060855"><span class="hs-identifier hs-var">static_info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Id -&gt; DataCon -&gt; [NonVoid StgArg] -&gt; Maybe CgIdInfo
</span><a href="GHC.StgToCmm.DataCon.html#precomputedStaticConInfo_maybe"><span class="hs-identifier hs-var">precomputedStaticConInfo_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060859"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060858"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060857"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060856"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-67"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681060852"><span class="annot"><span class="annottext">static_code :: FCode ()
</span><a href="#local-6989586621681060852"><span class="hs-identifier hs-var hs-var">static_code</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isInternalName"><span class="hs-identifier hs-var">isInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681060851"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681060850"><span class="hs-identifier hs-var">gen_code</span></a></span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- There is a pre-allocated static closure available; use it</span><span>
</span><span id="line-70"></span><span>    </span><span class="hs-comment">-- See Note [Precomputed static closures].</span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-comment">-- For External bindings we must keep the binding,</span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-comment">-- since importing modules will refer to it by name;</span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-comment">-- but for Internal ones we can drop it altogether</span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-comment">-- See Note [About the NameSorts] in &quot;GHC.Types.Name&quot; for Internal/External</span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060855"><span class="hs-identifier hs-var">static_info</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681060852"><span class="hs-identifier hs-var">static_code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-comment">-- Otherwise generate a closure for the constructor.</span><span>
</span><span id="line-78"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060849"><span class="hs-identifier hs-var">id_Info</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681060850"><span class="hs-identifier hs-var">gen_code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-82"></span><span>   </span><span id="local-6989586621681060849"><span class="annot"><span class="annottext">id_Info :: CgIdInfo
</span><a href="#local-6989586621681060849"><span class="hs-identifier hs-var hs-var">id_Info</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Id -&gt; LambdaFormInfo -&gt; CmmLit -&gt; CgIdInfo
</span><a href="GHC.StgToCmm.Env.html#litIdInfo"><span class="hs-identifier hs-var">litIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060859"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060858"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; LambdaFormInfo
</span><a href="GHC.StgToCmm.Closure.html#mkConLFInfo"><span class="hs-identifier hs-var">mkConLFInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060857"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681060845"><span class="hs-identifier hs-var">closure_label</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span>   </span><span id="local-6989586621681060851"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681060851"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060858"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-84"></span><span>   </span><span id="local-6989586621681060843"><span class="annot"><span class="annottext">caffy :: CafInfo
</span><a href="#local-6989586621681060843"><span class="hs-identifier hs-var hs-var">caffy</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CafInfo
</span><a href="GHC.Types.Id.html#idCafInfo"><span class="hs-identifier hs-var">idCafInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060858"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-comment">-- any stgArgHasCafRefs args</span><span>
</span><span id="line-85"></span><span>   </span><span id="local-6989586621681060845"><span class="annot"><span class="annottext">closure_label :: CLabel
</span><a href="#local-6989586621681060845"><span class="hs-identifier hs-var hs-var">closure_label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; CafInfo -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkClosureLabel"><span class="hs-identifier hs-var">mkClosureLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681060851"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="#local-6989586621681060843"><span class="hs-identifier hs-var">caffy</span></a></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>   </span><span id="local-6989586621681060850"><span class="annot"><span class="annottext">gen_code :: FCode ()
</span><a href="#local-6989586621681060850"><span class="hs-identifier hs-var hs-var">gen_code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-88"></span><span>     </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681060829"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681060829"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Module
</span><a href="GHC.StgToCmm.Monad.html#getModuleName"><span class="hs-identifier hs-var">getModuleName</span></a></span><span>
</span><span id="line-89"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; FCode () -&gt; FCode ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060859"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">OS -&gt; OS -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-90"></span><span>              </span><span class="hs-comment">-- Windows DLLs have a problem with static cross-DLL refs.</span><span>
</span><span id="line-91"></span><span>              </span><span class="hs-identifier">MASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isDllConApp</span><span> </span><span class="hs-identifier">dflags</span><span> </span><span class="hs-identifier">this_mod</span><span> </span><span class="hs-identifier">con</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">map</span><span> </span><span class="hs-identifier">fromNonVoid</span><span> </span><span class="hs-identifier">args</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">args</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">lengthIs</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">countConRepArgs</span><span> </span><span class="hs-identifier">con</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span>        </span><span class="hs-comment">-- LAY IT OUT</span><span>
</span><span id="line-95"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-96"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681060816"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060816"><span class="hs-identifier hs-var">tot_wds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-comment">--  #ptr_wds + #nonptr_wds</span><span>
</span><span id="line-97"></span><span>             </span><span id="local-6989586621681060815"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060815"><span class="hs-identifier hs-var">ptr_wds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-comment">--  #ptr_wds</span><span>
</span><span id="line-98"></span><span>             </span><span id="local-6989586621681060814"><span class="annot"><span class="annottext">[FieldOffOrPadding StgArg]
</span><a href="#local-6989586621681060814"><span class="hs-identifier hs-var">nv_args_w_offsets</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-99"></span><span>                 </span><span class="annot"><span class="annottext">DynFlags
-&gt; ClosureHeader
-&gt; [NonVoid (PrimRep, StgArg)]
-&gt; (Int, Int, [FieldOffOrPadding StgArg])
forall a.
DynFlags
-&gt; ClosureHeader
-&gt; [NonVoid (PrimRep, a)]
-&gt; (Int, Int, [FieldOffOrPadding a])
</span><a href="GHC.StgToCmm.Layout.html#mkVirtHeapOffsetsWithPadding"><span class="hs-identifier hs-var">mkVirtHeapOffsetsWithPadding</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060859"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureHeader
</span><a href="GHC.StgToCmm.Layout.html#StdHeader"><span class="hs-identifier hs-var">StdHeader</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[NonVoid StgArg] -&gt; [NonVoid (PrimRep, StgArg)]
</span><a href="GHC.StgToCmm.Closure.html#addArgReps"><span class="hs-identifier hs-var">addArgReps</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060856"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>            </span><span id="local-6989586621681060807"><span class="annot"><span class="annottext">mk_payload :: FieldOffOrPadding StgArg -&gt; FCode CmmLit
</span><a href="#local-6989586621681060807"><span class="hs-identifier hs-var hs-var">mk_payload</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Layout.html#Padding"><span class="hs-identifier hs-type">Padding</span></a></span><span> </span><span id="local-6989586621681060805"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060805"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; FCode CmmLit
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Width
</span><a href="GHC.Cmm.Type.html#widthFromBytes"><span class="hs-identifier hs-var">widthFromBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060805"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>            </span><span class="annot"><a href="#local-6989586621681060807"><span class="hs-identifier hs-var">mk_payload</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Layout.html#FieldOff"><span class="hs-identifier hs-type">FieldOff</span></a></span><span> </span><span id="local-6989586621681060801"><span class="annot"><span class="annottext">NonVoid StgArg
</span><a href="#local-6989586621681060801"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-103"></span><span>                </span><span id="local-6989586621681060800"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060800"><span class="hs-identifier hs-var">amode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NonVoid StgArg -&gt; FCode CmmExpr
</span><a href="GHC.StgToCmm.Env.html#getArgAmode"><span class="hs-identifier hs-var">getArgAmode</span></a></span><span> </span><span class="annot"><span class="annottext">NonVoid StgArg
</span><a href="#local-6989586621681060801"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-104"></span><span>                </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060800"><span class="hs-identifier hs-var">amode</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-105"></span><span>                  </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span id="local-6989586621681060797"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681060797"><span class="hs-identifier hs-var">lit</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; FCode CmmLit
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681060797"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-106"></span><span>                  </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; FCode CmmLit
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.StgToCmm.DataCon.cgTopRhsCon&quot;</span></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>            </span><span id="local-6989586621681060793"><span class="annot"><span class="annottext">nonptr_wds :: Int
</span><a href="#local-6989586621681060793"><span class="hs-identifier hs-var hs-var">nonptr_wds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060816"><span class="hs-identifier hs-var">tot_wds</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060815"><span class="hs-identifier hs-var">ptr_wds</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span>             </span><span class="hs-comment">-- we're not really going to emit an info table, so having</span><span>
</span><span id="line-111"></span><span>             </span><span class="hs-comment">-- to make a CmmInfoTable is a bit overkill, but mkStaticClosureFields</span><span>
</span><span id="line-112"></span><span>             </span><span class="hs-comment">-- needs to poke around inside it.</span><span>
</span><span id="line-113"></span><span>            </span><span id="local-6989586621681060792"><span class="annot"><span class="annottext">info_tbl :: CmmInfoTable
</span><a href="#local-6989586621681060792"><span class="hs-identifier hs-var hs-var">info_tbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DataCon -&gt; Bool -&gt; Int -&gt; Int -&gt; CmmInfoTable
</span><a href="GHC.StgToCmm.Closure.html#mkDataConInfoTable"><span class="hs-identifier hs-var">mkDataConInfoTable</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060859"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060857"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060815"><span class="hs-identifier hs-var">ptr_wds</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060793"><span class="hs-identifier hs-var">nonptr_wds</span></a></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681060790"><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681060790"><span class="hs-identifier hs-var">payload</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(FieldOffOrPadding StgArg -&gt; FCode CmmLit)
-&gt; [FieldOffOrPadding StgArg] -&gt; FCode [CmmLit]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">FieldOffOrPadding StgArg -&gt; FCode CmmLit
</span><a href="#local-6989586621681060807"><span class="hs-identifier hs-var">mk_payload</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldOffOrPadding StgArg]
</span><a href="#local-6989586621681060814"><span class="hs-identifier hs-var">nv_args_w_offsets</span></a></span><span>
</span><span id="line-117"></span><span>                </span><span class="hs-comment">-- NB1: nv_args_w_offsets is sorted into ptrs then non-ptrs</span><span>
</span><span id="line-118"></span><span>                </span><span class="hs-comment">-- NB2: all the amodes should be Lits!</span><span>
</span><span id="line-119"></span><span>                </span><span class="hs-comment">--      TODO (osa): Why?</span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span>                </span><span class="hs-comment">-- BUILD THE OBJECT</span><span>
</span><span id="line-122"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmInfoTable -&gt; CostCentreStack -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitDataCon"><span class="hs-identifier hs-var">emitDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681060845"><span class="hs-identifier hs-var">closure_label</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681060792"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="GHC.Types.CostCentre.html#dontCareCCS"><span class="hs-identifier hs-var">dontCareCCS</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681060790"><span class="hs-identifier hs-var">payload</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-126"></span><span class="hs-comment">--      Lay out and allocate non-top-level constructors</span><span>
</span><span id="line-127"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#buildDynCon"><span class="hs-identifier hs-type">buildDynCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>                 </span><span class="hs-comment">-- Name of the thing to which this constr will</span><span>
</span><span id="line-130"></span><span>                                  </span><span class="hs-comment">-- be bound</span><span>
</span><span id="line-131"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>               </span><span class="hs-comment">-- is it genuinely bound to that name, or just</span><span>
</span><span id="line-132"></span><span>                                  </span><span class="hs-comment">-- for profiling?</span><span>
</span><span id="line-133"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span>    </span><span class="hs-comment">-- Where to grab cost centre from;</span><span>
</span><span id="line-134"></span><span>                                  </span><span class="hs-comment">-- current CCS if currentOrSubsumedCCS</span><span>
</span><span id="line-135"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>            </span><span class="hs-comment">-- The data constructor</span><span>
</span><span id="line-136"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- Its args</span><span>
</span><span id="line-137"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span>               </span><span class="hs-comment">-- Return details about how to find it and initialization code</span><span>
</span><span id="line-139"></span><span id="buildDynCon"><span class="annot"><span class="annottext">buildDynCon :: Id
-&gt; Bool
-&gt; CostCentreStack
-&gt; DataCon
-&gt; [NonVoid StgArg]
-&gt; FCode (CgIdInfo, FCode CmmAGraph)
</span><a href="GHC.StgToCmm.DataCon.html#buildDynCon"><span class="hs-identifier hs-var hs-var">buildDynCon</span></a></span></span><span> </span><span id="local-6989586621681060786"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060786"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span id="local-6989586621681060785"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060785"><span class="hs-identifier hs-var">actually_bound</span></a></span></span><span> </span><span id="local-6989586621681060784"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681060784"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span id="local-6989586621681060783"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060783"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681060782"><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060782"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-140"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681060781"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060781"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-141"></span><span>         </span><span class="annot"><span class="annottext">DynFlags
-&gt; Id
-&gt; Bool
-&gt; CostCentreStack
-&gt; DataCon
-&gt; [NonVoid StgArg]
-&gt; FCode (CgIdInfo, FCode CmmAGraph)
</span><a href="GHC.StgToCmm.DataCon.html#buildDynCon%27"><span class="hs-identifier hs-var">buildDynCon'</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060781"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060786"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060785"><span class="hs-identifier hs-var">actually_bound</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681060784"><span class="hs-identifier hs-var">cc</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060783"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060782"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#buildDynCon%27"><span class="hs-identifier hs-type">buildDynCon'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-145"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-146"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span>
</span><span id="line-147"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span>
</span><span id="line-148"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-149"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">{- We used to pass a boolean indicating whether all the
args were of size zero, so we could use a static
constructor; but I concluded that it just isn't worth it.
Now I/O uses unboxed tuples there just aren't any constructors
with all size-zero args.

The reason for having a separate argument, rather than looking at
the addr modes of the args is that we may be in a &quot;knot&quot;, and
premature looking at the args will cause the compiler to black-hole!
-}</span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span id="buildDynCon%27"><span class="annot"><span class="annottext">buildDynCon' :: DynFlags
-&gt; Id
-&gt; Bool
-&gt; CostCentreStack
-&gt; DataCon
-&gt; [NonVoid StgArg]
-&gt; FCode (CgIdInfo, FCode CmmAGraph)
</span><a href="GHC.StgToCmm.DataCon.html#buildDynCon%27"><span class="hs-identifier hs-var hs-var">buildDynCon'</span></a></span></span><span> </span><span id="local-6989586621681060778"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060778"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681060777"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060777"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681060776"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681060776"><span class="hs-identifier hs-var">_cc</span></a></span></span><span> </span><span id="local-6989586621681060775"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060775"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681060774"><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060774"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681060773"><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060773"><span class="hs-identifier hs-var">cgInfo</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Id -&gt; DataCon -&gt; [NonVoid StgArg] -&gt; Maybe CgIdInfo
</span><a href="GHC.StgToCmm.DataCon.html#precomputedStaticConInfo_maybe"><span class="hs-identifier hs-var">precomputedStaticConInfo_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060778"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060777"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060775"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060774"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-comment">-- , pprTrace &quot;noCodeLocal:&quot; (ppr (binder,con,args,cgInfo)) True</span><span>
</span><span id="line-165"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CgIdInfo, FCode CmmAGraph) -&gt; FCode (CgIdInfo, FCode CmmAGraph)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060773"><span class="hs-identifier hs-var">cgInfo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkNop"><span class="hs-identifier hs-var">mkNop</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span class="hs-comment">-------- buildDynCon': the general case -----------</span><span>
</span><span id="line-168"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#buildDynCon%27"><span class="hs-identifier hs-var">buildDynCon'</span></a></span><span> </span><span id="local-6989586621681060771"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060771"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681060770"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060770"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span id="local-6989586621681060769"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060769"><span class="hs-identifier hs-var">actually_bound</span></a></span></span><span> </span><span id="local-6989586621681060768"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681060768"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621681060767"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060767"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681060766"><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060766"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681060765"><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060765"><span class="hs-identifier hs-var">id_info</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681060764"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060764"><span class="hs-identifier hs-var">reg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; LambdaFormInfo -&gt; FCode (CgIdInfo, LocalReg)
</span><a href="GHC.StgToCmm.Env.html#rhsIdInfo"><span class="hs-identifier hs-var">rhsIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060770"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="annot"><span class="annottext">LambdaFormInfo
</span><a href="#local-6989586621681060762"><span class="hs-identifier hs-var">lf_info</span></a></span><span>
</span><span id="line-170"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CgIdInfo, FCode CmmAGraph) -&gt; FCode (CgIdInfo, FCode CmmAGraph)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CgIdInfo
</span><a href="#local-6989586621681060765"><span class="hs-identifier hs-var">id_info</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; FCode CmmAGraph
</span><a href="#local-6989586621681060761"><span class="hs-identifier hs-var">gen_code</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060764"><span class="hs-identifier hs-var">reg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-172"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-173"></span><span>  </span><span id="local-6989586621681060762"><span class="annot"><span class="annottext">lf_info :: LambdaFormInfo
</span><a href="#local-6989586621681060762"><span class="hs-identifier hs-var hs-var">lf_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; LambdaFormInfo
</span><a href="GHC.StgToCmm.Closure.html#mkConLFInfo"><span class="hs-identifier hs-var">mkConLFInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060767"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span>  </span><span id="local-6989586621681060761"><span class="annot"><span class="annottext">gen_code :: LocalReg -&gt; FCode CmmAGraph
</span><a href="#local-6989586621681060761"><span class="hs-identifier hs-var hs-var">gen_code</span></a></span></span><span> </span><span id="local-6989586621681060758"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060758"><span class="hs-identifier hs-var">reg</span></a></span></span><span>
</span><span id="line-176"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681060757"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060757"><span class="hs-identifier hs-var">tot_wds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681060756"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060756"><span class="hs-identifier hs-var">ptr_wds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681060755"><span class="annot"><span class="annottext">[(NonVoid StgArg, Int)]
</span><a href="#local-6989586621681060755"><span class="hs-identifier hs-var">args_w_offsets</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [NonVoid (PrimRep, StgArg)]
-&gt; (Int, Int, [(NonVoid StgArg, Int)])
forall a.
DynFlags
-&gt; [NonVoid (PrimRep, a)] -&gt; (Int, Int, [(NonVoid a, Int)])
</span><a href="GHC.StgToCmm.Layout.html#mkVirtConstrOffsets"><span class="hs-identifier hs-var">mkVirtConstrOffsets</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060771"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[NonVoid StgArg] -&gt; [NonVoid (PrimRep, StgArg)]
</span><a href="GHC.StgToCmm.Closure.html#addArgReps"><span class="hs-identifier hs-var">addArgReps</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><a href="#local-6989586621681060766"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>                </span><span id="local-6989586621681060752"><span class="annot"><span class="annottext">nonptr_wds :: Int
</span><a href="#local-6989586621681060752"><span class="hs-identifier hs-var hs-var">nonptr_wds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060757"><span class="hs-identifier hs-var">tot_wds</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060756"><span class="hs-identifier hs-var">ptr_wds</span></a></span><span>
</span><span id="line-179"></span><span>                </span><span id="local-6989586621681060751"><span class="annot"><span class="annottext">info_tbl :: CmmInfoTable
</span><a href="#local-6989586621681060751"><span class="hs-identifier hs-var hs-var">info_tbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DataCon -&gt; Bool -&gt; Int -&gt; Int -&gt; CmmInfoTable
</span><a href="GHC.StgToCmm.Closure.html#mkDataConInfoTable"><span class="hs-identifier hs-var">mkDataConInfoTable</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060771"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060767"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-180"></span><span>                                </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060756"><span class="hs-identifier hs-var">ptr_wds</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060752"><span class="hs-identifier hs-var">nonptr_wds</span></a></span><span>
</span><span id="line-181"></span><span>          </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681060750"><span class="annot"><span class="annottext">ticky_name :: Maybe Id
</span><a href="#local-6989586621681060750"><span class="hs-identifier hs-var hs-var">ticky_name</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060769"><span class="hs-identifier hs-var">actually_bound</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe Id
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060770"><span class="hs-identifier hs-var">binder</span></a></span><span>
</span><span id="line-182"></span><span>                           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Id
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>          </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681060749"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060749"><span class="hs-identifier hs-var">hp_plus_n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Id
-&gt; CmmInfoTable
-&gt; LambdaFormInfo
-&gt; CmmExpr
-&gt; CmmExpr
-&gt; [(NonVoid StgArg, Int)]
-&gt; FCode CmmExpr
</span><a href="GHC.StgToCmm.Heap.html#allocDynClosure"><span class="hs-identifier hs-var">allocDynClosure</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="#local-6989586621681060750"><span class="hs-identifier hs-var">ticky_name</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681060751"><span class="hs-identifier hs-var">info_tbl</span></a></span><span> </span><span class="annot"><span class="annottext">LambdaFormInfo
</span><a href="#local-6989586621681060762"><span class="hs-identifier hs-var">lf_info</span></a></span><span>
</span><span id="line-185"></span><span>                                          </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060747"><span class="hs-identifier hs-var">use_cc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060746"><span class="hs-identifier hs-var">blame_cc</span></a></span><span> </span><span class="annot"><span class="annottext">[(NonVoid StgArg, Int)]
</span><a href="#local-6989586621681060755"><span class="hs-identifier hs-var">args_w_offsets</span></a></span><span>
</span><span id="line-186"></span><span>          </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode CmmAGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; LocalReg -&gt; LambdaFormInfo -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Env.html#mkRhsInit"><span class="hs-identifier hs-var">mkRhsInit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060771"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060758"><span class="hs-identifier hs-var">reg</span></a></span><span> </span><span class="annot"><span class="annottext">LambdaFormInfo
</span><a href="#local-6989586621681060762"><span class="hs-identifier hs-var">lf_info</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060749"><span class="hs-identifier hs-var">hp_plus_n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-187"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-188"></span><span>      </span><span id="local-6989586621681060747"><span class="annot"><span class="annottext">use_cc :: CmmExpr
</span><a href="#local-6989586621681060747"><span class="hs-identifier hs-var hs-var">use_cc</span></a></span></span><span>      </span><span class="hs-comment">-- cost-centre to stick in the object</span><span>
</span><span id="line-189"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; Bool
</span><a href="GHC.Types.CostCentre.html#isCurrentCCS"><span class="hs-identifier hs-var">isCurrentCCS</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681060768"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#cccsExpr"><span class="hs-identifier hs-var">cccsExpr</span></a></span><span>
</span><span id="line-190"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; CmmExpr
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;buildDynCon: non-current CCS not implemented&quot;</span></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span>      </span><span id="local-6989586621681060746"><span class="annot"><span class="annottext">blame_cc :: CmmExpr
</span><a href="#local-6989586621681060746"><span class="hs-identifier hs-var hs-var">blame_cc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681060747"><span class="hs-identifier hs-var">use_cc</span></a></span><span> </span><span class="hs-comment">-- cost-centre on which to blame the alloc (same)</span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="hs-comment">{- Note [Precomputed static closures]
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For Char/Int closures there are some value closures
built into the RTS. This is the case for all values in
the range mINT_INTLIKE .. mAX_INTLIKE (or CHARLIKE).
See Note [CHARLIKE and INTLIKE closures.] in the RTS code.

Similarly zero-arity constructors have a closure
in their defining Module we can use.

If possible we prefer to refer to those existing
closure instead of building new ones.

This is true at compile time where we do this replacement
in this module.
But also at runtime where the GC does the same (but only for
INT/CHAR closures).

`precomputedStaticConInfo_maybe` checks if a given constructor application
can be replaced with a reference to a existing static closure.

If so the code will reference the existing closure when accessing
the binding.
Unless the binding is visible to other modules we also generate
no code for the binding itself. We can do this since then we can
always reference the existing closure.

See Note [About the NameSorts] for the definition of external names.
For external bindings we must still generate a closure,
but won't use it inside this module.
This can sometimes reduce cache pressure. Since:
* If somebody uses the exported binding:
  + This module will reference the existing closure.
  + GC will reference the existing closure.
  + The importing module will reference the built closure.
* If nobody uses the exported binding:
  + This module will reference the RTS closures.
  + GC references the RTS closures

In the later case we avoided loading the built closure into the cache which
is what we optimize for here.

Consider this example using Ints.

    module M(externalInt, foo, bar) where

    externalInt = 1 :: Int
    internalInt = 1 :: Int
    { -# NOINLINE foo #- }
    foo = Just internalInt :: Maybe Int
    bar = Just externalInt

    ==================== STG: ====================
    externalInt = I#! [1#];

    bar = Just! [externalInt];

    internalInt_rc = I#! [2#];

    foo = Just! [internalInt_rc];

For externally visible bindings we must generate closures
since those may be referenced by their symbol `&lt;name&gt;_closure`
when imported.

`externalInt` is visible to other modules so we generate a closure:

    [section &quot;&quot;data&quot; . M.externalInt_closure&quot; {
        M.externalInt_closure:
            const GHC.Types.I#_con_info;
            const 1;
    }]

It will be referenced inside this module via `M.externalInt_closure+1`

`internalInt` is however a internal name. As such we generate no code for
it. References to it are replaced with references to the static closure as
we can see in the closure built for `foo`:

    [section &quot;&quot;data&quot; . M.foo_closure&quot; {
        M.foo_closure:
            const GHC.Maybe.Just_con_info;
            const stg_INTLIKE_closure+289; // == I# 2
            const 3;
    }]

This holds for both local and top level bindings.

We don't support this optimization when compiling into Windows DLLs yet
because they don't support cross package data references well.
-}</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="hs-comment">-- (precomputedStaticConInfo_maybe dflags id con args)</span><span>
</span><span id="line-288"></span><span class="hs-comment">--     returns (Just cg_id_info)</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- if there is a precomputed static closure for (con args).</span><span>
</span><span id="line-290"></span><span class="hs-comment">-- In that case, cg_id_info addresses it.</span><span>
</span><span id="line-291"></span><span class="hs-comment">-- See Note [Precomputed static closures]</span><span>
</span><span id="line-292"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#precomputedStaticConInfo_maybe"><span class="hs-identifier hs-type">precomputedStaticConInfo_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html#DataCon"><span class="hs-identifier hs-type">DataCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#CgIdInfo"><span class="hs-identifier hs-type">CgIdInfo</span></a></span><span>
</span><span id="line-293"></span><span id="precomputedStaticConInfo_maybe"><span class="annot"><span class="annottext">precomputedStaticConInfo_maybe :: DynFlags -&gt; Id -&gt; DataCon -&gt; [NonVoid StgArg] -&gt; Maybe CgIdInfo
</span><a href="GHC.StgToCmm.DataCon.html#precomputedStaticConInfo_maybe"><span class="hs-identifier hs-var hs-var">precomputedStaticConInfo_maybe</span></a></span></span><span> </span><span id="local-6989586621681060742"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060742"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681060741"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060741"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span id="local-6989586621681060740"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060740"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-294"></span><span class="hs-comment">-- Nullary constructors</span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="GHC.Core.DataCon.html#isNullaryRepDataCon"><span class="hs-identifier hs-var">isNullaryRepDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060740"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CgIdInfo -&gt; Maybe CgIdInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(CgIdInfo -&gt; Maybe CgIdInfo) -&gt; CgIdInfo -&gt; Maybe CgIdInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Id -&gt; LambdaFormInfo -&gt; CmmLit -&gt; CgIdInfo
</span><a href="GHC.StgToCmm.Env.html#litIdInfo"><span class="hs-identifier hs-var">litIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060742"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060741"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; LambdaFormInfo
</span><a href="GHC.StgToCmm.Closure.html#mkConLFInfo"><span class="hs-identifier hs-var">mkConLFInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060740"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; CafInfo -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkClosureLabel"><span class="hs-identifier hs-var">mkClosureLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; Name
</span><a href="GHC.Core.DataCon.html#dataConName"><span class="hs-identifier hs-var">dataConName</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060740"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CafInfo
</span><a href="GHC.Types.Id.Info.html#NoCafRefs"><span class="hs-identifier hs-var">NoCafRefs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#precomputedStaticConInfo_maybe"><span class="hs-identifier hs-var">precomputedStaticConInfo_maybe</span></a></span><span> </span><span id="local-6989586621681060737"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681060736"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060736"><span class="hs-identifier hs-var">binder</span></a></span></span><span> </span><span id="local-6989586621681060735"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060735"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681060734"><span class="annot"><span class="annottext">NonVoid StgArg
</span><a href="#local-6989586621681060734"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">]</span><span>
</span><span id="line-299"></span><span>  </span><span class="hs-comment">-- Int/Char values with existing closures in the RTS</span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060733"><span class="hs-identifier hs-var">intClosure</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060731"><span class="hs-identifier hs-var">charClosure</span></a></span><span>
</span><span id="line-301"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformOS"><span class="hs-identifier hs-var">platformOS</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681060730"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">OS -&gt; OS -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="../../ghc-boot/src/GHC.Platform.html#OSMinGW32"><span class="hs-identifier hs-var">OSMinGW32</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#positionIndependent"><span class="hs-identifier hs-var">positionIndependent</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681060727"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060727"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NonVoid StgArg -&gt; Maybe Integer
</span><a href="#local-6989586621681060726"><span class="hs-identifier hs-var">getClosurePayload</span></a></span><span> </span><span class="annot"><span class="annottext">NonVoid StgArg
</span><a href="#local-6989586621681060734"><span class="hs-identifier hs-var">arg</span></a></span><span>
</span><span id="line-303"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Bool
</span><a href="#local-6989586621681060725"><span class="hs-identifier hs-var">inRange</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060727"><span class="hs-identifier hs-var">val</span></a></span><span>
</span><span id="line-304"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681060724"><span class="annot"><span class="annottext">intlike_lbl :: CLabel
</span><a href="#local-6989586621681060724"><span class="hs-identifier hs-var hs-var">intlike_lbl</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; FastString -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCmmClosureLabel"><span class="hs-identifier hs-var">mkCmmClosureLabel</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#rtsUnitId"><span class="hs-identifier hs-var">rtsUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681060720"><span class="hs-keyword hs-var">label</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span>        </span><span id="local-6989586621681060716"><span class="annot"><span class="annottext">val_int :: Int
</span><a href="#local-6989586621681060716"><span class="hs-identifier hs-var hs-var">val_int</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060727"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-306"></span><span>        </span><span id="local-6989586621681060709"><span class="annot"><span class="annottext">offsetW :: Int
</span><a href="#local-6989586621681060709"><span class="hs-identifier hs-var hs-var">offsetW</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060716"><span class="hs-identifier hs-var">val_int</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060708"><span class="hs-identifier hs-var">min_static_range</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Runtime.Heap.Layout.html#fixedHdrSizeW"><span class="hs-identifier hs-var">fixedHdrSizeW</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>                </span><span class="hs-comment">-- INTLIKE/CHARLIKE closures consist of a header and one word payload</span><span>
</span><span id="line-308"></span><span>        </span><span id="local-6989586621681060704"><span class="annot"><span class="annottext">static_amode :: CmmLit
</span><a href="#local-6989586621681060704"><span class="hs-identifier hs-var hs-var">static_amode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CLabel -&gt; Int -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#cmmLabelOffW"><span class="hs-identifier hs-var">cmmLabelOffW</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681060730"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681060724"><span class="hs-identifier hs-var">intlike_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060709"><span class="hs-identifier hs-var">offsetW</span></a></span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">CgIdInfo -&gt; Maybe CgIdInfo
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(CgIdInfo -&gt; Maybe CgIdInfo) -&gt; CgIdInfo -&gt; Maybe CgIdInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Id -&gt; LambdaFormInfo -&gt; CmmLit -&gt; CgIdInfo
</span><a href="GHC.StgToCmm.Env.html#litIdInfo"><span class="hs-identifier hs-var">litIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060736"><span class="hs-identifier hs-var">binder</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; LambdaFormInfo
</span><a href="GHC.StgToCmm.Closure.html#mkConLFInfo"><span class="hs-identifier hs-var">mkConLFInfo</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060735"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681060704"><span class="hs-identifier hs-var">static_amode</span></a></span><span>
</span><span id="line-310"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-311"></span><span>    </span><span id="local-6989586621681060730"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681060730"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-312"></span><span>    </span><span id="local-6989586621681060733"><span class="annot"><span class="annottext">intClosure :: Bool
</span><a href="#local-6989586621681060733"><span class="hs-identifier hs-var hs-var">intClosure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="GHC.Builtin.Utils.html#maybeIntLikeCon"><span class="hs-identifier hs-var">maybeIntLikeCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060735"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-313"></span><span>    </span><span id="local-6989586621681060731"><span class="annot"><span class="annottext">charClosure :: Bool
</span><a href="#local-6989586621681060731"><span class="hs-identifier hs-var hs-var">charClosure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Bool
</span><a href="GHC.Builtin.Utils.html#maybeCharLikeCon"><span class="hs-identifier hs-var">maybeCharLikeCon</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060735"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-314"></span><span>    </span><span id="local-6989586621681060726"><span class="annot"><span class="annottext">getClosurePayload :: NonVoid StgArg -&gt; Maybe Integer
</span><a href="#local-6989586621681060726"><span class="hs-identifier hs-var hs-var">getClosurePayload</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-type">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><a href="GHC.Types.Literal.html#LitNumInt"><span class="hs-identifier hs-var">LitNumInt</span></a></span><span> </span><span id="local-6989586621681060694"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060694"><span class="hs-identifier hs-var">val</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Maybe Integer
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060694"><span class="hs-identifier hs-var">val</span></a></span><span>
</span><span id="line-315"></span><span>    </span><span class="annot"><a href="#local-6989586621681060726"><span class="hs-identifier hs-var">getClosurePayload</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-type">StgLitArg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitChar"><span class="hs-identifier hs-type">LitChar</span></a></span><span> </span><span id="local-6989586621681060692"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681060692"><span class="hs-identifier hs-var">val</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Maybe Integer
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(Integer -&gt; Maybe Integer) -&gt; Integer -&gt; Maybe Integer
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Integer) -&gt; (Char -&gt; Int) -&gt; Char -&gt; Integer
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Integer) -&gt; Char -&gt; Integer
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681060692"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-316"></span><span>    </span><span class="annot"><a href="#local-6989586621681060726"><span class="hs-identifier hs-var">getClosurePayload</span></a></span><span> </span><span class="annot"><span class="annottext">NonVoid StgArg
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Integer
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-317"></span><span>    </span><span class="hs-comment">-- Avoid over/underflow by comparisons at type Integer!</span><span>
</span><span id="line-318"></span><span>    </span><span class="annot"><a href="#local-6989586621681060725"><span class="hs-identifier hs-type">inRange</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-319"></span><span>    </span><span id="local-6989586621681060725"><span class="annot"><span class="annottext">inRange :: Integer -&gt; Bool
</span><a href="#local-6989586621681060725"><span class="hs-identifier hs-var hs-var">inRange</span></a></span></span><span> </span><span id="local-6989586621681060689"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060689"><span class="hs-identifier hs-var">val</span></a></span></span><span>
</span><span id="line-320"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060689"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060708"><span class="hs-identifier hs-var">min_static_range</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060689"><span class="hs-identifier hs-var">val</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621681060687"><span class="hs-identifier hs-var">max_static_range</span></a></span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span>    </span><span class="annot"><a href="#local-6989586621681060708"><span class="hs-identifier hs-type">min_static_range</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>
</span><span id="line-323"></span><span>    </span><span id="local-6989586621681060708"><span class="annot"><span class="annottext">min_static_range :: Integer
</span><a href="#local-6989586621681060708"><span class="hs-identifier hs-var hs-var">min_static_range</span></a></span></span><span>
</span><span id="line-324"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060733"><span class="hs-identifier hs-var">intClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#mIN_INTLIKE"><span class="hs-identifier hs-var">mIN_INTLIKE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060731"><span class="hs-identifier hs-var">charClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#mIN_CHARLIKE"><span class="hs-identifier hs-var">mIN_CHARLIKE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-326"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Integer
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;precomputedStaticConInfo_maybe: Unknown closure type&quot;</span></span><span>
</span><span id="line-327"></span><span>    </span><span id="local-6989586621681060687"><span class="annot"><span class="annottext">max_static_range :: Integer
</span><a href="#local-6989586621681060687"><span class="hs-identifier hs-var hs-var">max_static_range</span></a></span></span><span>
</span><span id="line-328"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060733"><span class="hs-identifier hs-var">intClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#mAX_INTLIKE"><span class="hs-identifier hs-var">mAX_INTLIKE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060731"><span class="hs-identifier hs-var">charClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#mAX_CHARLIKE"><span class="hs-identifier hs-var">mAX_CHARLIKE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060737"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Integer
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;precomputedStaticConInfo_maybe: Unknown closure type&quot;</span></span><span>
</span><span id="line-331"></span><span>    </span><span id="local-6989586621681060720"><span class="annot"><span class="annottext">label :: String
</span><a href="#local-6989586621681060720"><span class="hs-keyword hs-var hs-var">label</span></a></span></span><span>
</span><span id="line-332"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060733"><span class="hs-identifier hs-var">intClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;stg_INTLIKE&quot;</span></span><span>
</span><span id="line-333"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681060731"><span class="hs-identifier hs-var">charClosure</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;stg_CHARLIKE&quot;</span></span><span>
</span><span id="line-334"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;precomputedStaticConInfo_maybe: Unknown closure type&quot;</span></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#precomputedStaticConInfo_maybe"><span class="hs-identifier hs-var">precomputedStaticConInfo_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[NonVoid StgArg]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CgIdInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-339"></span><span class="hs-comment">--      Binding constructor arguments</span><span>
</span><span id="line-340"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#bindConArgs"><span class="hs-identifier hs-type">bindConArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#AltCon"><span class="hs-identifier hs-type">AltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- bindConArgs is called from cgAlt of a case</span><span>
</span><span id="line-344"></span><span class="hs-comment">-- (bindConArgs con args) augments the environment with bindings for the</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- binders args, assuming that we have just returned from a 'case' which</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- found a con</span><span>
</span><span id="line-347"></span><span id="bindConArgs"><span class="annot"><span class="annottext">bindConArgs :: AltCon -&gt; LocalReg -&gt; [NonVoid Id] -&gt; FCode [LocalReg]
</span><a href="GHC.StgToCmm.DataCon.html#bindConArgs"><span class="hs-identifier hs-var hs-var">bindConArgs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#DataAlt"><span class="hs-identifier hs-type">DataAlt</span></a></span><span> </span><span id="local-6989586621681060677"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060677"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681060676"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060676"><span class="hs-identifier hs-var">base</span></a></span></span><span> </span><span id="local-6989586621681060675"><span class="annot"><span class="annottext">[NonVoid Id]
</span><a href="#local-6989586621681060675"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-348"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">not</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">isUnboxedTupleCon</span><span> </span><span class="hs-identifier">con</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-349"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681060673"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060673"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-350"></span><span>       </span><span id="local-6989586621681060672"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681060672"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-351"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681060670"><span class="annot"><span class="annottext">[(NonVoid Id, Int)]
</span><a href="#local-6989586621681060670"><span class="hs-identifier hs-var">args_w_offsets</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [NonVoid (PrimRep, Id)] -&gt; (Int, Int, [(NonVoid Id, Int)])
forall a.
DynFlags
-&gt; [NonVoid (PrimRep, a)] -&gt; (Int, Int, [(NonVoid a, Int)])
</span><a href="GHC.StgToCmm.Layout.html#mkVirtConstrOffsets"><span class="hs-identifier hs-var">mkVirtConstrOffsets</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060673"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[NonVoid Id] -&gt; [NonVoid (PrimRep, Id)]
</span><a href="GHC.StgToCmm.Closure.html#addIdReps"><span class="hs-identifier hs-var">addIdReps</span></a></span><span> </span><span class="annot"><span class="annottext">[NonVoid Id]
</span><a href="#local-6989586621681060675"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-352"></span><span>           </span><span id="local-6989586621681060668"><span class="annot"><span class="annottext">tag :: Int
</span><a href="#local-6989586621681060668"><span class="hs-identifier hs-var hs-var">tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DataCon -&gt; Int
</span><a href="GHC.StgToCmm.Closure.html#tagForCon"><span class="hs-identifier hs-var">tagForCon</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681060673"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681060677"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span>           </span><span class="hs-comment">-- The binding below forces the masking out of the tag bits</span><span>
</span><span id="line-355"></span><span>           </span><span class="hs-comment">-- when accessing the constructor field.</span><span>
</span><span id="line-356"></span><span>           </span><span class="annot"><a href="#local-6989586621681060666"><span class="hs-identifier hs-type">bind_arg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#ByteOff"><span class="hs-identifier hs-type">ByteOff</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>           </span><span id="local-6989586621681060666"><span class="annot"><span class="annottext">bind_arg :: (NonVoid Id, Int) -&gt; FCode (Maybe LocalReg)
</span><a href="#local-6989586621681060666"><span class="hs-identifier hs-var hs-var">bind_arg</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681060664"><span class="annot"><span class="annottext">arg :: NonVoid Id
</span><a href="#local-6989586621681060664"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.StgToCmm.Closure.html#NonVoid"><span class="hs-identifier hs-type">NonVoid</span></a></span><span> </span><span id="local-6989586621681060663"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060663"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681060662"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060662"><span class="hs-identifier hs-var">offset</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-358"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Id.html#isDeadBinder"><span class="hs-identifier hs-var">isDeadBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681060663"><span class="hs-identifier hs-var">b</span></a></span><span>  </span><span class="hs-comment">-- See Note [Dead-binder optimisation] in GHC.StgToCmm.Expr</span><span>
</span><span id="line-359"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe LocalReg -&gt; FCode (Maybe LocalReg)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LocalReg
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-360"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-361"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; LocalReg -&gt; LocalReg -&gt; Int -&gt; Int -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#mkTaggedObjectLoad"><span class="hs-identifier hs-var">mkTaggedObjectLoad</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681060672"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; NonVoid Id -&gt; LocalReg
</span><a href="GHC.StgToCmm.Env.html#idToReg"><span class="hs-identifier hs-var">idToReg</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681060672"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">NonVoid Id
</span><a href="#local-6989586621681060664"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-362"></span><span>                                              </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060676"><span class="hs-identifier hs-var">base</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060662"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681060668"><span class="hs-identifier hs-var">tag</span></a></span><span>
</span><span id="line-363"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LocalReg -&gt; Maybe LocalReg
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(LocalReg -&gt; Maybe LocalReg)
-&gt; FCode LocalReg -&gt; FCode (Maybe LocalReg)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">NonVoid Id -&gt; FCode LocalReg
</span><a href="GHC.StgToCmm.Env.html#bindArgToReg"><span class="hs-identifier hs-var">bindArgToReg</span></a></span><span> </span><span class="annot"><span class="annottext">NonVoid Id
</span><a href="#local-6989586621681060664"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span>       </span><span class="annot"><span class="annottext">((NonVoid Id, Int) -&gt; FCode (Maybe LocalReg))
-&gt; [(NonVoid Id, Int)] -&gt; FCode [LocalReg]
forall (m :: * -&gt; *) a b.
Applicative m =&gt;
(a -&gt; m (Maybe b)) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#mapMaybeM"><span class="hs-identifier hs-var">mapMaybeM</span></a></span><span> </span><span class="annot"><span class="annottext">(NonVoid Id, Int) -&gt; FCode (Maybe LocalReg)
</span><a href="#local-6989586621681060666"><span class="hs-identifier hs-var">bind_arg</span></a></span><span> </span><span class="annot"><span class="annottext">[(NonVoid Id, Int)]
</span><a href="#local-6989586621681060670"><span class="hs-identifier hs-var">args_w_offsets</span></a></span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="annot"><a href="GHC.StgToCmm.DataCon.html#bindConArgs"><span class="hs-identifier hs-var">bindConArgs</span></a></span><span> </span><span id="local-6989586621681060655"><span class="annot"><span class="annottext">AltCon
</span><a href="#local-6989586621681060655"><span class="hs-identifier hs-var">_other_con</span></a></span></span><span> </span><span id="local-6989586621681060654"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681060654"><span class="hs-identifier hs-var">_base</span></a></span></span><span> </span><span id="local-6989586621681060653"><span class="annot"><span class="annottext">[NonVoid Id]
</span><a href="#local-6989586621681060653"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-368"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">args</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-369"></span></pre></body></html>